<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2021/11/7
  Time: 15:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="/admin/css/pintuer.css">
    <link rel="stylesheet" href="/admin/css/admin.css">
    <script src="/admin/js/jquery.js"></script>
    <script src="/admin/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
    <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>修改用户</strong></div>
    <div class="body-content">
        <form  class="form-x" onsubmit="return false">
            <div class="form-group">
                <div class="label">
                    <label>ID：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${u.id}" id="id" readonly />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>用户名：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${u.username}" id="username" readonly />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>密码：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${u.pwd}" id="pwd" readonly />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>年龄：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${u.age}" id="age"  />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>性别：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${u.sex}" id="sex"  />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>地址：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${u.address}" id="address"  />
                    <div class="tips"></div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>发布时间：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${u.dates}" id="dates" readonly  />
                    <div class="tips"></div>
                </div>
            </div>



            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <button class="button bg-main icon-check-square-o"  type="button"> 提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/login/js/Treatment.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/login/layui/layui.js"></script>
<link href="${pageContext.request.contextPath}/login/layui/css/layui.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">

    layui.use('layer',function () {
        $('button[type="button"]').click(function() {

        var id = $("#id").val();
        var username = $("#username").val();
        var age = $("#age").val();
        var sex = $("#sex").val();
        var address = $("#address").val();
        var pwd = $("#pwd").val();
        var dates = $("#dates").val();

        var params = {
            id:id,
            username:username,
            age:age,
            sex:sex,
            address:address,
            pwd:pwd,
            dates:dates,
        }

        $.post("/admin/updateUserRes",params,function (res) {
            console.log(res);
            if(res.code === 200){
                OkAlert("修改成功");
            }
            else{
                ErroAlert("修改失败");

            }

        },"json");
    })
    })
</script>

</body></html>
